<html><head><title>TimeConsuming.h</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="sourcestyles.css" />
</head><body link="blue" vlink="blue">
<h3>File: D:\project4\WaveFrontSensor\TimeConsuming.h</h3>
<SCRIPT>
defaultStatus = "File: D:\\project4\\WaveFrontSensor\\TimeConsuming.h";
top.document.title  = "TimeConsuming.h";
</SCRIPT>
<pre><span class="default"></span><a name="1"><font size=-1>1     </font></a><span class="default"></span><span class="preproc">#pragma </span><span class="default">once</span>
<a name="2"><font size=-1>2     </font></a><span class="default"></span><span class="comment">/*****************************************************************//**</span>
<a name="3"><font size=-1>3     </font></a><span class="comment"> * \file    TimeConsuming.h</span>
<a name="4"><font size=-1>4     </font></a><span class="comment"> * \brief   用来计算单线程或者多线程执行函数的复杂度</span>
<a name="5"><font size=-1>5     </font></a><span class="comment"> * \author  Administrator</span>
<a name="6"><font size=-1>6     </font></a><span class="comment"> * \date    November 2023</span>
<a name="7"><font size=-1>7     </font></a><span class="comment"> *********************************************************************/</span>
<a name="8"><font size=-1>8     </font></a><span class="comment"></span><span class="preproc">#include </span><span class="string">&lt;chrono&gt;</span>
<a name="9"><font size=-1>9     </font></a><span class="string"></span>
<a name="10"><font size=-1>10     </font></a><span class="string"></span>
<a name="11"><font size=-1>11     </font></a><span class="string"></span><span class="keyword">class <a href="dictionary_T.html#2">TimeConsuming</a></span><span class="default">{</span>
<a name="12"><font size=-1>12     </font></a><span class="default"></span><span class="keyword">private</span><span class="default">:</span>
<a name="13"><font size=-1>13     </font></a><span class="default">	std::chrono::steady_clock::time_point start;</span>
<a name="14"><font size=-1>14     </font></a><span class="default">	std::chrono::steady_clock::time_point  end;</span>
<a name="15"><font size=-1>15     </font></a><span class="default"></span><span class="keyword">public</span><span class="default">:</span>
<a name="16"><font size=-1>16     </font></a><span class="default">	<a href="dictionary_T.html#3">TimeConsuming</a>() {</span>
<a name="17"><font size=-1>17     </font></a><span class="default"></span>
<a name="18"><font size=-1>18     </font></a><span class="default">	}</span>
<a name="19"><font size=-1>19     </font></a><span class="default">	~<a href="dictionary_T.html#15">TimeConsuming</a>() = </span><span class="keyword">default</span><span class="default">;</span>
<a name="20"><font size=-1>20     </font></a><span class="default">	<a href="dictionary_T.html#4">TimeConsuming</a>(</span><span class="keyword">const <a href="dictionary_T.html#2">TimeConsuming</a></span><span class="default">&amp; <a href="dictionary_O.html#5">object</a>) = </span><span class="keyword">default</span><span class="default">;</span>
<a name="21"><font size=-1>21     </font></a><span class="default">	<a href="dictionary_T.html#6">TimeConsuming</a>(<a href="dictionary_T.html#2">TimeConsuming</a>&amp;&amp; <a href="dictionary_O.html#7">object</a>) = </span><span class="keyword">default</span><span class="default">;</span>
<a name="22"><font size=-1>22     </font></a><span class="default"></span><span class="keyword">public</span><span class="default">:</span>
<a name="23"><font size=-1>23     </font></a><span class="default"></span>
<a name="24"><font size=-1>24     </font></a><span class="default">	</span><span class="keyword">void <a href="dictionary_T.html#12">setStartTime</a></span><span class="default">(std::chrono::steady_clock::time_point&amp; <a href="dictionary_S.html#13">start_</a>) {</span>
<a name="25"><font size=-1>25     </font></a><span class="default"></span>
<a name="26"><font size=-1>26     </font></a><span class="default">		start = start;</span>
<a name="27"><font size=-1>27     </font></a><span class="default">	}</span>
<a name="28"><font size=-1>28     </font></a><span class="default"></span>
<a name="29"><font size=-1>29     </font></a><span class="default">	</span><span class="keyword">void <a href="dictionary_T.html#10">setEndTime</a></span><span class="default">(std::chrono::steady_clock::time_point&amp; <a href="dictionary_E.html#11">end_</a>) {</span>
<a name="30"><font size=-1>30     </font></a><span class="default"></span>
<a name="31"><font size=-1>31     </font></a><span class="default">		end = end_;</span>
<a name="32"><font size=-1>32     </font></a><span class="default">	}</span>
<a name="33"><font size=-1>33     </font></a><span class="default"></span>
<a name="34"><font size=-1>34     </font></a><span class="default">	std::chrono::duration&lt;</span><span class="keyword">double</span><span class="default">&gt; <a href="dictionary_T.html#8">calculateDuration</a>() {</span>
<a name="35"><font size=-1>35     </font></a><span class="default"></span>
<a name="36"><font size=-1>36     </font></a><span class="default">		</span><span class="keyword">return </span><span class="default">std::chrono::duration_cast&lt;std::chrono::duration&lt;</span><span class="keyword">double</span><span class="default">&gt;&gt;(end-start);</span>
<a name="37"><font size=-1>37     </font></a><span class="default"></span>
<a name="38"><font size=-1>38     </font></a><span class="default">	}</span>
<a name="39"><font size=-1>39     </font></a><span class="default">};</span>
<a name="40"><font size=-1>40     </font></a><span class="default"></span>
</pre></body></html>
